﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BusinessComponents;
using DataAccessLayer;
namespace Tester
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
          
            Guest g = new Guest();
            g.Address = "BLK 335, #03-14, Clementi Ave 2";
            g.City = "Singapore";
            g.Country = "Singapore";
            g.CreditNumber = "1111-2222-3333-4444";
            g.CVVNumber = "123";
            g.Email = "Email@email.com";
            g.FirstName = "Cherry";
            g.LastName = "Cherry";
            g.Phone = "12345654";
            g.ZipPostalCode = "123456";
            BusinessComponentsFacade facade = new BusinessComponentsFacade();
            facade.AddGuest(g);
            MessageBox.Show("Added");


        }

        private void button2_Click(object sender, EventArgs e)
        {
            RoomType rt = new RoomType();
            rt.RoomTypeName = "Delux Double";
            rt.NumberOfBed = 2;
            rt.NumberOfRoom = 20;
            rt.Price = 199;
            rt.Description = "Delux Room with big shower Room";
            BusinessComponentsFacade facade = new BusinessComponentsFacade();
            facade.AddRoomType(rt);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            BusinessComponentsFacade facade = new BusinessComponentsFacade();
           

            Random random = new Random();

            int randomNumber = random.Next(0, 100000);
            Booking b = new Booking();
           
            b.BookingNumber = Convert.ToString(randomNumber);
            b.GuestID = 1;
            b.BookingStatus = "C";
            b.CreatedOn = DateTime.Now;
            b.TotalPrice = 500;
            b.BookingDetailID = 1;
            DateTime startDate = new DateTime(2013, 5, 21);
            b.StartDate = startDate;
            DateTime endDate = new DateTime(2013, 5, 22);
            b.EndDate = endDate;
            BookingDetail bd = new BookingDetail();
            bd.BookingID=(b.ID);
            bd.RoomTypeID=(1);
            bd.RoomCount=(1);
             
            facade.MakeReservation(b,bd);

        }
    }
}
